
#include "BattleLineCardManager.h"

CBattleLineCardManager::CBattleLineCardManager(void)
{
}

CBattleLineCardManager::~CBattleLineCardManager(void)
{
}

void CBattleLineCardManager::Init()
{
	CGameEntityAsset::Init();

	CBattleLineCard* pCard;
	int numNum = CBattleLineCard::CARD_NUM_END - CBattleLineCard::CARD_NUM_START + 1;
	int numTactic = CBattleLineCard::CARD_TACTIC_END - CBattleLineCard::CARD_TACTIC_START + 1;
	for(int i = 0;i < numNum;i++)
	{
		for(int j = 0;j < 10;j++)
		{
			pCard = new CBattleLineCard;
			pCard->Init( (CBattleLineCard::CARD_TYPE )(CBattleLineCard::CARD_NUM_START + i),j+1);
			m_oGameEntityList.push_back(pCard);
		}
	}

	for(int i = 0;i < numTactic;i++)
	{
		pCard = new CBattleLineCard;
		pCard->Init( (CBattleLineCard::CARD_TYPE )( CBattleLineCard::CARD_TACTIC_START + i ), -1 );
		m_oGameEntityList.push_back(pCard);
	}
}

void CBattleLineCardManager::Update(float fTime)
{
	CGameEntityAsset::Update(fTime);

	for(vector<CGameEntity*>::iterator it = m_oGameEntityList.begin();it != m_oGameEntityList.end();it++)
	{
		(*it)->Update(fTime);
	}
}

void CBattleLineCardManager::Render()
{
	CGameEntityAsset::Render();

	for(vector<CGameEntity*>::iterator it = m_oGameEntityList.begin();it != m_oGameEntityList.end();it++)
	{
		(*it)->Render();
	}
}

void CBattleLineCardManager::Deinit()
{
	for(vector<CGameEntity*>::iterator it = m_oGameEntityList.begin();it != m_oGameEntityList.end();it++)
	{
		(*it)->Deinit();
		delete (*it);
	}
	m_oGameEntityList.clear();

	CGameEntityAsset::Deinit();
}